package modelLayer;
import java.io.Serializable;

/**
 * 
 * @author Nick D Pedersen 
 * @version 1.0
 * 
 */
public class Tree implements Serializable
{
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// instance variables - replace the example below with your own
    private String sort;
    private double lifespan;
    private double squareKilometer;
    private double costPerSquareKilometer;
    private double revenuePerSquareKilometer;
    private int id;
    private static int nr = 1;
    private Forest forest;
    /**
     * Constructor for objects of class Tree
     */
    public Tree(String sort, double lifespan,double squareKilometer, double costPerSquareKilometer, double revenuePerSquareKilometer, Forest forest)
    {
        this.sort = sort;
        this.lifespan = lifespan;
        this.squareKilometer = squareKilometer;
        this.costPerSquareKilometer = costPerSquareKilometer;
        this.revenuePerSquareKilometer = revenuePerSquareKilometer;
        this.forest = forest;
        this.id = nr;
        nr++;
    }

    /**
     * Get'n Setters.
     */
    
    public int getId(){
        return id;
    }
    
    public Forest getForest() {
		return forest;
	}

	public void setForest(Forest forest) {
		this.forest = forest;
	}

	public String getSort(){
        return sort;
    }
    public void setSort(String sort){
        this.sort = sort;
    }
    public double getLifespan(){
        return lifespan;
    }
    public void setLifespan(double lifespan){
        this.lifespan = lifespan;
    }
    public double getCostPerSquareKilometer(){
        return costPerSquareKilometer;
    }
    public void setCostPerSquareKilometer(double costPerSquareKilometer){
        this.costPerSquareKilometer = costPerSquareKilometer;
    }
    public double getRevenuePerSquareKilometer(){
        return revenuePerSquareKilometer;
    }
    public void setRevenuePerSquareKilometer(double revenuePerSquareKilometer){
        this.revenuePerSquareKilometer = revenuePerSquareKilometer;
    }
    public double getSquareKilometer(){
        return squareKilometer;
    }
    
    public void setSquareKilometer(double squareKilometer){
        this.squareKilometer = squareKilometer;
    }
    
    /**
     * Prints all the information from the class Tree.
     */
    public String toString(){
        String s = sort + " / Km2: " + squareKilometer;
        return s;
    }
}
